home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / virus / nsh232e4.zip / NSH232.4 / SITEXPRS / SCRIPTS / WSCN228E.DCL < prev    next >
Text File  |  1996-05-15  |  4KB  |  104 lines

  1. REM ::ExeType=Windows
  2. REM ::ExePath=H:\SITEXPRS\SCRIPTS\WSCN228E.EXE
  3.  
  4.  
  5. 'SiteExpress 3.0 Sample Script
  6. 'Automated Install for VirusScan for Windows
  7. '12/16/95 
  8. 'Authors: Heather Stern, Mike Wheeler
  9. 'McAfee Associates 1995, All rights reserved
  10. '
  11. 'Note: This Script is designed for client installs to Windows versions 3.X only
  12.  
  13. CONST INSTITLE$    ="VirusScan for Windows Install"
  14. CONST CRLF$        =CHR$(13)+CHR$(10)
  15.  
  16. Sub Notify(blurb$)
  17.         ' Keep the user informed, so they don't think the script is hung.
  18.         ' Make sure the borderless dialog is not in use by another application.
  19.     MsgClose
  20.         ' Create one with:
  21.         '    our message
  22.         '    until closed
  23.         '    no Cancel -- change to TRUE if you want users to be able to interrupt
  24.         '    or thermometer
  25.         '    at x,y (if x,y is left off, the dialog will center)
  26.     MsgOpen blurb, 0, FALSE, FALSE
  27.     Sleep 5000            'sleep if you are using the message box without buttons...
  28. End Sub
  29.  
  30. Sub ScriptDone(blurb$,good%)
  31.     MsgClose    ' so we don't leave the borderless dialog hanging
  32.     if good then
  33.         msg$=blurb$
  34.     else
  35.         msg$=blurb$+CRLF+" Please contact your System Administrator."
  36.     end if
  37.     MsgBox msg$,0,INSTITLE$
  38.     If Not good then
  39.         END
  40.     End If
  41. End Sub
  42.  
  43. Sub MakeIcon(ico$)
  44.         'initiate a DDE converstation with the shell, ask it to create a group and icon
  45.         'this method should work under most Program Manager replacements.
  46.     DDETimeout 5000    'set time out to 5 seconds (default is 10000 milliseconds)
  47.     channel% = DDEInitiate("progman","progman")
  48.     if channel = 0 then
  49.         DDETerminateAll  'just in case the shell doesn't respond
  50.         ScriptDone "Unable to initiate DDE with your shell - no icon was created."+CRLF+"You will need to run C:\MCAFEE\VIRUSCAN\WSCAN.EXE"+CRLF+"to launch Windows VirusScan.",TRUE
  51.     end if
  52.         ' note: It is possible to add more DDE to ask if a McAfee VirusScan group already exists.
  53.     DDEExecute channel,"[CreateGroup(McAfee VirusScan)]"
  54.     DDEExecute channel,"[ShowGroup(McAfee VirusScan,1)]"
  55.     DDEExecute channel,"[AddItem("+ico$+")]"
  56.     DDETerminateAll
  57. End Sub
  58.  
  59. sub main()
  60.     Notify "Welcome to the SiteExpress McAfee VirusScan Installer"
  61.     Notify "Please wait, VirusScan Install is initializing..."
  62.     FreeSpace& = DiskFree ("C")
  63.     If NOT FreeSpace > 1750000 then        'Check for Free Disk Space (1.75 MB) on drive C
  64.         ScriptDone "Not Enough Free Space on Drive C.",FALSE
  65.     End If
  66.     here$=CurDir$()
  67.  
  68.     Notify "Finding ZIP source"
  69.     If FileExists ("C:\SXP300\WSC-228E.ZIP") then
  70.         source$="C:\SXP300\WSC-228E.ZIP"
  71.     Else
  72.         ScriptDone "WSC-228E.ZIP was not found.",FALSE
  73.     End If
  74.  
  75.     Notify "Checking that PKUNZIP is available"
  76.     If FileExists ("C:\SXP300\PKUNZIP.EXE") then
  77.         pk$="C:\SXP300\PKUNZIP.EXE"
  78.     Else
  79.         ScriptDone "PKUNZIP was not found.",FALSE
  80.     End If
  81.  
  82.     If NOT DirExists ("C:\MCAFEE\VIRUSCAN") then
  83.         MkDir "C:\MCAFEE\VIRUSCAN"            'create the taget directory
  84. '    Else
  85. '        Kill "C:\MCAFEE\VIRUSCAN\*.*"            'delete the current version
  86.     End If
  87.     dest$="C:\MCAFEE\VIRUSCAN"
  88.     Notify "Decompressing "+source$+"..."
  89.     id%=Shell(pk$+" -o "+source$+" "+dest$)
  90.     WaitForTaskCompletion id        'If installing to Windows 3.X only
  91.         'sleep 10000                    'Otherwise just sleep 10 seconds
  92.                                 'so that WIN31 and WIN95 can both work...
  93.     If id% > 0 AND id% < 32 then ScriptDone "Decompression failed!", FALSE
  94.     Notify "Windows Scan is now installed.  Creating icon..."
  95.     MakeIcon dest$+"\wscan.exe"
  96.     ScriptDone "Congratulations, the installation is complete!",TRUE
  97.     Notify "Lauching VirusScan for Windows..."    
  98.     WSCAN% = Shell ("C:\MCAFEE\VIRUSCAN\WSCAN.EXE")
  99.     WinActivate "McAfee VirusScan for Windows"    'switch focus to another window
  100.     Notify "Starting Scan, Please Wait..."
  101.     Sleep 10000                                'Wait, WSCAN could GPF if we try to Scan before it finishes intializing...
  102.     Menu "Scan.StartScan"                        'select menu item from current app
  103. end sub
  104.